package cn.imvc.app.repositories;

import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import cn.imvc.app.entities.Voucher;
import cn.imvc.data.jpa.repository.IJpqlExecutor;

public interface VoucherRepository extends JpaRepository<Voucher, Integer>, IJpqlExecutor<Voucher> {
	
	List<Voucher> findByMemberIdAndLimitMoneyLessThanAndStateAndStartDateLessThanAndEndDateGreaterThan(Integer memberId,int orderAmount,byte state,Date startDate,Date endDate);
	
	Page<Voucher> findByMemberId(Integer memberId,Pageable pageable);
}
